package com.aaa.service.impl;

import com.aaa.dao.RoleMapper;
import com.aaa.entity.Role;
import com.aaa.service.RoleServiceDao;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RoleServiceimpl extends ServiceImpl<RoleMapper,Role> implements RoleServiceDao {
    @Resource
    RoleMapper roleDao;

    public List<Role> find() {
        return roleDao.selectList(null);
    }

    public int add(Role role) {
        return roleDao.insert(role);
    }

    public int update(Role role) {
        return roleDao.updateById(role);
    }

    public int delete(Integer rid) {
        return roleDao.deleteById(rid);
    }

    @Override
    public List<Role> findpage(Integer pageSize, Integer pageNum) {
        return roleDao.findpage(pageSize, pageNum);
    }

    @Override
    public Integer findcount() {
        return roleDao.findcount();
    }
}
